<!DOCTYPE html>
<html lang="en">

<head>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>点点控 - 像搭积木一样构建智能物联网</title>

    <!-- Bootstrap Core CSS -->
    <link href="../vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">

    <!-- MetisMenu CSS -->
    <link href="../vendor/metisMenu/metisMenu.min.css" rel="stylesheet">

    <!-- Custom CSS -->
    <link href="../assets/css/sb-admin-2.css" rel="stylesheet">

    <!-- Custom Fonts -->
    <link href="../vendor/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">

    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
        <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
        <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
    <script type="text/javascript" src="/assets/js/blockly_compressed.js"></script>
    <script type="text/javascript" src="/assets/js/blocks_compressed.js"></script>
    <script type="text/javascript" src="/assets/js/javascript_compressed.js"></script>
    <script type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/jquery/jquery-1.7.2.min.js"></script>
    <script type="text/javascript" src="/assets/js/Blob.js"></script>
    <script type="text/javascript" src="/assets/js/FileSaver.min.js"></script>
    <script src="../assets/js/msg/zh-hans.js"></script>

    <style>
        body {
            background-color: #fff;
            font-family: sans-serif;
        }
        h1 {
            font-weight: normal;
            font-size: 140%;
        }
    </style>
</head>

<body>

    <div id="wrapper">

        <!-- Navigation -->
        <?php include 'nav.php'; ?>

        <div id="page-wrapper">
            <div class="row">
                <div class="col-lg-12">
                    <h1 class="page-header">可视化设计</h1>
                </div>
                <!-- /.col-lg-12 -->
            </div>
            <!-- /.row -->
            <div class="row">
                <div class="col-lg-12">
                    <div class="panel panel-default">
                        <div class="panel-heading">
                            使用可视化设计器自定义Iot原件
                        </div>
                        <div class="panel-body">
                            <div class="row">
                                <div class="col-lg-12">
                                    <xml id="toolbox" style="display: none">

                                        <category name="流程">
                                            <block type="controls_if"></block>

                                            <block type="logic_compare"></block>
                                            <block type="math_number"></block>
                                            <block type="condtioner">
                                                <value name="temperature">
                                                    <block type="math_number">
                                                        <field name="NUM">0</field>
                                                    </block>
                                                </value>
                                            </block>
                                            <block type="open_door"></block>
                                            <block type="close_door"></block>
                                            <block type="temperature"></block>  <!-- 温度值，返回数值-->
                                            <block type="face_match"></block> <!-- 识别脸，返回布尔值-->
                                            <block type="win1"></block>     <!-- 窗户1，返回布尔值-->
                                            <block type="win2"></block>     <!-- 窗户2，返回布尔值-->
                                            <block type="win3"></block>     <!-- 窗户3，返回布尔值-->
                                            <block type = "state_save"></block> <!-- 状态存证,输入三个窗户的状态-->

                                            <block type="controls_repeat_ext">
                                                <value name="TIMES">
                                                    <block type="math_number">
                                                        <field name="NUM">10</field>
                                                    </block>
                                                </value>
                                            </block>
                                            <block type="controls_whileUntil"></block>
                                            <block type="controls_for">
                                                <field name="VAR">i</field>
                                                <value name="FROM">
                                                    <block type="math_number">
                                                        <field name="NUM">1</field>
                                                    </block>
                                                </value>
                                                <value name="TO">
                                                    <block type="math_number">
                                                        <field name="NUM">10</field>
                                                    </block>
                                                </value>
                                                <value name="BY">
                                                    <block type="math_number">
                                                        <field name="NUM">1</field>
                                                    </block>
                                                </value>
                                            </block>
                                        </category>
                                        <category name="数学">
                                            <block type="math_random_int"></block>
                                            <block type="math_arithmetic"></block>
                                            <block type="math_number"></block>
                                        </category>

                                        <sep gap="8"></sep>
                                        <category custom="VARIABLE" name="变量">

                                    </xml>
                                    <script>

                                    </script>

                                    <table   width = 100% >
                                        <tr align=center> <td colspan = 3>
                                                <h1>点点控 </h1>

                                                <p id="state">已经停止</p>
                                                <p>
                                                    <button onclick="showXml()">Show xml</button>
                                                    <button onclick="showJsCode()">Show Js</button>
                                                    <!--  <button onclick="runCode()">runCode</button> -->
                                                    <button onclick="run()">run</button>
                                                    <button onclick="stop()">stop</button>
                                                    <button onclick="upload()">上载XML</button>
                                                    <button onclick="save()">保存XML</button>
                                                    <button onclick="load_it()">加载本地文件</button>
                                                    <input type="file" id="load" style="display: none;"/>
                                                </p>

                                            </td></tr>

                                        <tr align=center>  <td><div id="blocklyDiv" style = "height:420px"></div></td></tr>


                                    </table>

                                    <table   width = 50% align=center>
                                        <tr align=center>
                                            <td id="temperature">温度:<span id="temperature_span">0</span></td>
                                            <td>面部识别:<span>识别成功</span></td>
                                            <td id="conditioner">空调设置<span id="conditioner_set">0</span></td>
                                            <td id="door">门:<span id="door_op">关</span></td>
                                            <td >窗户1:<span>关</span></td>
                                            <td>窗户2:<span>关</span></td>
                                            <td>窗户3:<span>关</span></td>
                                        </tr>
                                    </table>

                                </div>
                            </div>
                            <!-- /.row (nested) -->
                        </div>
                        <!-- /.panel-body -->
                    </div>
                    <!-- /.panel -->
                </div>
                <!-- /.col-lg-12 -->
            </div>
            <!-- /.row -->
        </div>
        <!-- /#page-wrapper -->

    </div>
    <!-- /#wrapper -->

    <!-- jQuery -->
    <script src="../vendor/jquery/jquery.min.js"></script>
    <!-- Bootstrap Core JavaScript -->
    <script src="../vendor/bootstrap/js/bootstrap.min.js"></script>
    <!-- Metis Menu Plugin JavaScript -->
    <script src="../vendor/metisMenu/metisMenu.min.js"></script>
    <!-- Custom Theme JavaScript -->
    <script src="../assets/js/sb-admin-2.js"></script>

    <script type="text/javascript" src="../assets/js/diandiankong.js"></script>
    <script>

    </script>
</body>
</html>
